import request from "@/utils/request";

/**
 * 获取用户信息
 * @returns
 */
export const getUserInfo = () =>
  request({
    url: "/api/user",
    method: "get",
  });

/**
 * 修改用户信息
 * @param {*} data
 * @returns
 */
export const updateUserInfo = (data) =>
  request({
    url: "/api/user",
    method: "put",
    data,
  });

/**
 * @description 微信登录
 **/
export const code2AccessToken = (data) =>
  request({
    url: `/api/user/wxLogin`,
    method: "post",
    data,
  });

/**
 * 获取并验证微信绑定手机号
 * @param {*} data 
 * @returns 
 */
export const checkWxPhoneNumber = (data) => {
  return request({
    url: `/api/user/getPhone`,
    method: "post",
    data,
  });
};
